<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      function zhishu(a) {
        var count = 0;
        for (var i = 1; i <= a; i++) {
          if (a % i == 0) {
            //循环出数字的约数
            count++;
            //   console.log(count);
          }
        }
        //如果打印count两次就是质数（质数只有1和它本身）
        if (count == 2) {
          return true;
        } else {
          return false;
        }
      }
      for (var i = 4; i <= 100; i += 2) {
        for (var j = 2; j < i; j++) {
          if (zhishu(j) && zhishu(i - j)) {
            console.log(i + "的质数和等于" + j + "与" + (i - j));
          }
        }
      }
    </script>
  </head>
  <body></body>
</html>
